This will avoid too many open files at the same time that could cause
an EMFILE error.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit
bc092b06f0e34e93f7d6102957bf55fd7ffd1b9e)
guint8 opcode;
OstreeStaticDeltaOperation *op;
+ /* Limit the number of outstanding writes to 1 to prevent too many open files
+ at the same time. */
+ while (state->outstanding_content_writes > 1)
+ g_main_context_iteration (state->content_writing_context, TRUE);
+
if (state->object_start)
{
if (!open_output_target (state, cancellable, error))